/*
 +-----------------------------------------------------------------------------------------------+
 | Project : UKAPI
 +-----------------------------------------------------------------------------------------------+
 | Project Description : Universal & Kernel API
 +-----------------------------------------------------------------------------------------------+
 | File Description :
 |   File
 |                                                 
 +-----------------------------------------------------------------------------------------------+
 | Licence : MIT Licence
 +-----------------------------------------------------------------------------------------------+
 | Copyright (c) 2006 Olivier Vanhoucke
 | 
 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
 | and associated documentation files (the "Software"), to deal in the Software without 
 | restriction, including without limitation the rights to use, copy, modify, merge, publish, 
 | distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 
 | Software is furnished to do so, subject to the following conditions:
 | 
 | The above copyright notice and this permission notice shall be included in all copies or 
 | substantial portions of the Software.
 | 
 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 +-----------------------------------------------------------------------------------------------+
*/

#ifndef __UKAPI_KERNEL_FILE__
#define __UKAPI_KERNEL_FILE__

#include <ukapi.h>

typedef struct
{
	char toto;
} file_t, * pfile_t;

typedef struct
{
	char toto;
} file_info_t, * pfile_info_t;

typedef struct
{
	char toto;
} file_seek_t, * pfile_seek_t;

typedef enum
{
	create_always_e,
	open_always_e,
	open_or_create_e,
} file_action_t, * pfile_action_t;

typedef enum
{
	file_access_read_only_e,
	file_access_write_only_e,
	file_access_read_write_e,
} file_access_t, * pfile_access_t;

#ifdef __cplusplus
	extern "C" {
#endif /* __cplusplus */

result_t file_create( pfile_t file, const string_unicode_t file_path, file_action_t action, file_access_t access );
result_t file_open( pfile_t file, const string_unicode_t file_path, file_access_t access );
result_t file_read( pfile_t file, pbyte_t buffer, size_t buffer_size, size_t readed_size );
result_t file_write( pfile_t file, pbyte_t buffer, size_t buffer_size );
result_t file_close( pfile_t file );
//result_t file_chmod( pfile_t file ); // ?
result_t file_info( pfile_t file, pfile_info_t file_info );
result_t file_seek( pfile_t file, file_seek_t seek );

bool_t file_exists( const string_unicode_t file_path );
result_t file_copy( const string_unicode_t source_file_path, const string_unicode_t destination_file_path, bool_t overwrite );
result_t file_move( const string_unicode_t source_file_path, const string_unicode_t destination_file_path, bool_t overwrite );
result_t file_delete( const string_unicode_t file_path );
result_t file_rename( const string_unicode_t old_name,  const string_unicode_t new_name );

#ifdef __cplusplus
	}
#endif /* __cplusplus */

#endif /* __UKAPI_KERNEL_FILE__ */